#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QApplication>
#include <QQmlContext>
#include <QQuickView>
#include <QQuickItem>
//#include <QQuickStyle>
#include <QUrl>
#include <QDebug>
#include <QFile>
//#include "ukuimenubackground.h"
//#include "menu/menu.h"
//#include "menu/dtk/dpopupwindowhandle_p.h"
//#include "menu/dtk/dquickbehindwindowblur_p.h"

// MenuModel.h
#include <QAbstractListModel>
#include <QStringList>

class MenuModel : public QAbstractListModel {
    Q_OBJECT
public:
    enum RoleNames {
        TextRole = Qt::UserRole + 1,
        ActionRole
    };

    explicit MenuModel(QObject *parent = nullptr);

    // 必须实现的虚函数
    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
    QHash<int, QByteArray> roleNames() const override;

    // 添加菜单项的方法
    Q_INVOKABLE void addItem(const QString &text, const QString &action);

    Q_INVOKABLE void removeItem();

    Q_INVOKABLE QColor selfHardLight();

    Q_INVOKABLE QColor hightlight();

private:
    struct MenuItem {
        QString text;
        QString action;
    };
    QList<MenuItem> m_items;
};

